<?php

/**
 * Contains functions for the search engine
 * 
 * @author Imsirovic Dominik
 */
class Model_Search{
    
    
    /**
     *Returns all users whose email address, name or location contains
     * a given word.
     * @param type $word - the used search item
     * @return type Array of users
     */
   public function simpleSearch($word){
       
      $db = Zend_Registry::get("my_db");
      $stmt = "SELECT * FROM users WHERE LOCATE('$word',emailAddress)>0 OR LOCATE('$word',name)>0
                OR LOCATE('$word',userName)>0 OR LOCATE('$word',location)>0";
      $result = $db->fetchAll($stmt);
      return $result;
       
   }
    
    
    
    
}

?>
